package com.example.startup.task

import android.content.Context
import android.util.Log
import com.example.startup.AndroidStartUp
import com.example.startup.StartUp
import kotlinx.coroutines.delay

class Task2: AndroidStartUp<Any>() {

    companion object{
        val list = ArrayList<Class<out StartUp<*>>>()

        /**
         * 任务2依赖于任务1
         */
        init {
            list.add(Task1::class.java)
        }
    }

    override suspend fun create(context: Context): Any? {
        Log.d(TAG,"Task2 学习socket")
        delay(800)
        Log.d(TAG,"Task2 学习完毕socket")
        return null
    }


    override fun dependencies(): List<Class<out StartUp<*>>>? {
        return list
    }
}